<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <title>ActionMailer::Collector</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <link rel="stylesheet" href="../../css/reset.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../../css/main.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../../css/github.css" type="text/css" media="screen" />
<script src="../../js/jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script>
<script src="../../js/jquery-effect.js" type="text/javascript" charset="utf-8"></script>
<script src="../../js/main.js" type="text/javascript" charset="utf-8"></script>
<script src="../../js/highlight.pack.js" type="text/javascript" charset="utf-8"></script>

</head>

<body>     
    <div class="banner">
        
            <span>Ruby on Rails v4.0.0</span><br />
        
        <h1>
            <span class="type">Class</span> 
            ActionMailer::Collector 
            
                <span class="parent">&lt; 
                    
                    <a href="../Object.html">Object</a>
                    
                </span>
            
        </h1>
        <ul class="files">
            
            <li><a href="../../files/actionmailer/lib/action_mailer/collector_rb.html">actionmailer/lib/action_mailer/collector.rb</a></li>
            
        </ul>
    </div>
    <div id="bodyContent">
        <div id="content">
  


  


  
  


  


  
    <!-- Method ref -->
    <div class="sectiontitle">Methods</div>
    <dl class="methods">
      
        <dt>A</dt>
        <dd>
          <ul>
            
              
              <li>
                <a href="Collector.html#method-i-all">all</a>,
              </li>
            
              
              <li>
                <a href="Collector.html#method-i-any">any</a>
              </li>
            
          </ul>
        </dd>
      
        <dt>C</dt>
        <dd>
          <ul>
            
              
              <li>
                <a href="Collector.html#method-i-custom">custom</a>
              </li>
            
          </ul>
        </dd>
      
        <dt>N</dt>
        <dd>
          <ul>
            
              
              <li>
                <a href="Collector.html#method-c-new">new</a>
              </li>
            
          </ul>
        </dd>
      
    </dl>
  

  
    <!-- Includes -->
    <div class="sectiontitle">Included Modules</div>
    <ul>
      
        <li>
          
            <a href="../AbstractController/Collector.html">
              AbstractController::Collector
            </a>
          
        </li>
      
    </ul>
  



  

    

    

    


    
      <!-- Section attributes -->
      <div class="sectiontitle">Attributes</div>
      <table border='0' cellpadding='5'>
        
          <tr valign='top'>
            <td class='attr-rw'>
              [R]
            </td>
            <td class='attr-name'>responses</td>
            <td class='attr-desc'></td>
          </tr>
        
      </table>
    


    <!-- Methods -->
    
      <div class="sectiontitle">Class Public methods</div>
      
        <div class="method">
          <div class="title method-title" id="method-c-new">
            
              <b>new</b>(context, &amp;block)
            
            <a href="Collector.html#method-c-new" name="method-c-new" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-c-new_source')" id="l_method-c-new_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/975493a17202b7fc8da0bccb3d5caaf2bd0851d8/actionmailer/lib/action_mailer/collector.rb#L10" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-c-new_source" class="dyn-source">
                <pre><span class="ruby-comment"># File actionmailer/lib/action_mailer/collector.rb, line 10</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">initialize</span>(<span class="ruby-identifier">context</span>, &amp;<span class="ruby-identifier">block</span>)
  <span class="ruby-ivar">@context</span> = <span class="ruby-identifier">context</span>
  <span class="ruby-ivar">@responses</span> = []
  <span class="ruby-ivar">@default_render</span> = <span class="ruby-identifier">block</span>
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
                  
      <div class="sectiontitle">Instance Public methods</div>
      
        <div class="method">
          <div class="title method-title" id="method-i-all">
            
              <b>all</b>(*args, &amp;block)
            
            <a href="Collector.html#method-i-all" name="method-i-all" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              
            </div>
          
          
          
          
          
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-i-any">
            
              <b>any</b>(*args, &amp;block)
            
            <a href="Collector.html#method-i-any" name="method-i-any" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              
            </div>
          
          
          
            <div class="aka">
              Also aliased as: <a href="Collector.html#method-i-all">all</a>
            </div>
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-i-any_source')" id="l_method-i-any_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/975493a17202b7fc8da0bccb3d5caaf2bd0851d8/actionmailer/lib/action_mailer/collector.rb#L16" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-i-any_source" class="dyn-source">
                <pre><span class="ruby-comment"># File actionmailer/lib/action_mailer/collector.rb, line 16</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">any</span>(*<span class="ruby-identifier">args</span>, &amp;<span class="ruby-identifier">block</span>)
  <span class="ruby-identifier">options</span> = <span class="ruby-identifier">args</span>.<span class="ruby-identifier">extract_options!</span>
  <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-string">&quot;You have to supply at least one format&quot;</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">args</span>.<span class="ruby-identifier">empty?</span>
  <span class="ruby-identifier">args</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">type</span><span class="ruby-operator">|</span> <span class="ruby-identifier">send</span>(<span class="ruby-identifier">type</span>, <span class="ruby-identifier">options</span>.<span class="ruby-identifier">dup</span>, &amp;<span class="ruby-identifier">block</span>) }
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-i-custom">
            
              <b>custom</b>(mime, options = {})
            
            <a href="Collector.html#method-i-custom" name="method-i-custom" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-i-custom_source')" id="l_method-i-custom_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/975493a17202b7fc8da0bccb3d5caaf2bd0851d8/actionmailer/lib/action_mailer/collector.rb#L23" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-i-custom_source" class="dyn-source">
                <pre><span class="ruby-comment"># File actionmailer/lib/action_mailer/collector.rb, line 23</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">custom</span>(<span class="ruby-identifier">mime</span>, <span class="ruby-identifier">options</span> = {})
  <span class="ruby-identifier">options</span>.<span class="ruby-identifier">reverse_merge!</span>(<span class="ruby-identifier">content_type</span><span class="ruby-operator">:</span> <span class="ruby-identifier">mime</span>.<span class="ruby-identifier">to_s</span>)
  <span class="ruby-ivar">@context</span>.<span class="ruby-identifier">formats</span> = [<span class="ruby-identifier">mime</span>.<span class="ruby-identifier">to_sym</span>]
  <span class="ruby-identifier">options</span>[<span class="ruby-value">:body</span>] = <span class="ruby-identifier">block_given?</span> <span class="ruby-operator">?</span> <span class="ruby-keyword">yield</span> <span class="ruby-operator">:</span> <span class="ruby-ivar">@default_render</span>.<span class="ruby-identifier">call</span>
  <span class="ruby-ivar">@responses</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">options</span>
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
                    </div>

    </div>
  </body>
</html>    